<!doctype html>
<html class="theme-next   use-motion ">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />












  <link href="/vendors/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css"/>




  <link href="//fonts.googleapis.com/css?family=Lato:300,400,700,400italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">



<link href="/vendors/font-awesome/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=0.4.5.2" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="uml," />








  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=0.4.5.2" />






<meta name="description" content="What is UML&amp;gt;The Unified Modeling Language(UML) is a general-purpose, developmental, modeling language in the field of software engineering, that is intended to provide a standard way to visualize t">
<meta property="og:type" content="article">
<meta property="og:title" content="Understanding UML">
<meta property="og:url" content="https://lechance.github.io/posts/2016/03/07/unified-modeling-language-tutorial/index.html">
<meta property="og:site_name" content="Lechance's Blog">
<meta property="og:description" content="What is UML&amp;gt;The Unified Modeling Language(UML) is a general-purpose, developmental, modeling language in the field of software engineering, that is intended to provide a standard way to visualize t">
<meta property="og:image" content="https://lechance.github.io/images/uml/uml_usecase.jpg">
<meta property="og:image" content="https://lechance.github.io/images/uml/uml_component.jpg">
<meta property="og:image" content="https://lechance.github.io/images/uml/uml_node.jpg">
<meta property="og:image" content="https://lechance.github.io/images/uml/uml_message.jpg">
<meta property="og:image" content="https://lechance.github.io/images/uml/uml_state.jpg">
<meta property="og:image" content="https://lechance.github.io/images/uml/uml_package.jpg">
<meta property="og:image" content="https://lechance.github.io/images/uml/uml_note.jpg">
<meta property="og:image" content="https://lechance.github.io/images/uml/uml_dependency.jpg">
<meta property="og:image" content="https://lechance.github.io/images/uml/uml_association.jpg">
<meta property="og:image" content="https://lechance.github.io/images/uml/uml_generalization.jpg">
<meta property="og:image" content="https://lechance.github.io/images/uml/uml_realization.jpg">
<meta property="og:image" content="https://lechance.github.io/images/uml/notation_class.jpg">
<meta property="og:image" content="https://lechance.github.io/images/uml/notation_object.jpg">
<meta property="og:image" content="https://lechance.github.io/images/uml/notation_interface.jpg">
<meta property="og:image" content="https://lechance.github.io/images/uml/notation_collaboration.jpg">
<meta property="og:image" content="https://lechance.github.io/images/uml/notation_usecase.jpg">
<meta property="og:image" content="https://lechance.github.io/images/uml/notation_actor.jpg">
<meta property="og:image" content="https://lechance.github.io/images/uml/notation_initialstate.jpg">
<meta property="og:image" content="https://lechance.github.io/images/uml/notation_finalstate.jpg">
<meta property="og:image" content="https://lechance.github.io/images/uml/notation_activeclass.jpg">
<meta property="og:image" content="https://lechance.github.io/images/uml/notation_component.jpg">
<meta property="og:image" content="https://lechance.github.io/images/uml/notation_node.jpg">
<meta property="og:image" content="https://lechance.github.io/images/uml/notation_interaction.jpg">
<meta property="og:image" content="https://lechance.github.io/images/uml/notation_statemachine.jpg">
<meta property="og:image" content="https://lechance.github.io/images/uml/notation_package.jpg">
<meta property="og:image" content="https://lechance.github.io/images/uml/notation_note.jpg">
<meta property="og:image" content="https://lechance.github.io/images/uml/notation_dependency.jpg">
<meta property="og:image" content="https://lechance.github.io/images/uml/notation_association.jpg">
<meta property="og:image" content="https://lechance.github.io/images/uml/notation_generalization.jpg">
<meta property="og:image" content="https://lechance.github.io/images/uml/notation_extensibility.jpg">
<meta property="og:updated_time" content="2016-08-04T07:17:41.179Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Understanding UML">
<meta name="twitter:description" content="What is UML&amp;gt;The Unified Modeling Language(UML) is a general-purpose, developmental, modeling language in the field of software engineering, that is intended to provide a standard way to visualize t">



<script type="text/javascript" id="hexo.configuration">
  var CONFIG = {
    scheme: '',
    sidebar: 'hide',
    motion: true
  };
</script>

  <title> Understanding UML | Lechance's Blog </title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="en">

  <!--[if lte IE 8]>
  <div style=' clear: both; height: 59px; padding:0 0 0 15px; position: relative;margin:0 auto;'>
    <a href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home?ocid=ie6_countdown_bannercode">
      <img src="http://7u2nvr.com1.z0.glb.clouddn.com/picouterie.jpg" border="0" height="42" width="820"
           alt="You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today or use other browser ,like chrome firefox safari."
           style='margin-left:auto;margin-right:auto;display: block;'/>
    </a>
  </div>
<![endif]-->
  


<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  ga('create', 'UA-75174040-1', 'auto');
  ga('send', 'pageview');
</script>


  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "//hm.baidu.com/hm.js?5641a55459d47b98c90f424b8ca53a5a";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




  <div class="container one-column page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-meta ">
  

  <div class="custom-logo-site-title">
    <a href="/"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">Lechance's Blog</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
  <p class="site-subtitle"></p>
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu ">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-home fa-fw"></i> <br />
            
            Home
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-archive fa-fw"></i> <br />
            
            Archives
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-tags fa-fw"></i> <br />
            
            Tags
          </a>
        </li>
      
        
        <li class="menu-item menu-item-links">
          <a href="/links" rel="section">
            
              <i class="menu-item-icon fa fa-link fa-fw"></i> <br />
            
            Links
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about" rel="section">
            
              <i class="menu-item-icon fa fa-user fa-fw"></i> <br />
            
            About
          </a>
        </li>
      
        
        <li class="menu-item menu-item-rss">
          <a href="/atom.xml" rel="section">
            
              <i class="menu-item-icon fa fa-rss fa-fw"></i> <br />
            
            Rss
          </a>
        </li>
      

      
      
    </ul>
  

  
</nav>

 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div id="content" class="content">
          

  <div id="posts" class="posts-expand">
    

  
  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                Understanding UML
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            Posted on
            <time itemprop="dateCreated" datetime="2016-03-07T13:15:42+08:00" content="2016-03-07">
              2016-03-07
            </time>
          </span>

          
            <span class="post-category" >
              &nbsp; | &nbsp; In
              
                <span itemprop="about" itemscope itemtype="https://schema.org/Thing">
                  <a href="/categories/Design/" itemprop="url" rel="index">
                    <span itemprop="name">Design</span>
                  </a>
                </span>

                
                

              
            </span>
          

          
            
              <span class="post-comments-count">
                &nbsp; | &nbsp;
                <a href="/posts/2016/03/07/unified-modeling-language-tutorial/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count ds-thread-count" data-thread-key="posts/2016/03/07/unified-modeling-language-tutorial/" itemprop="commentsCount"></span>
                </a>
              </span>
            
          

          
		  
		  
			 &nbsp; | &nbsp;
			 <span id="/posts/2016/03/07/unified-modeling-language-tutorial/"class="leancloud_visitors"  data-flag-title="Understanding UML">
             &nbsp;Views
            </span>
		  
		
        </div>
      </header>
    


    <div class="post-body">

      
      

      
        <span itemprop="articleBody"><h3 id="What_is_UML">What is UML</h3><p>&gt;<br>The <strong>Unified Modeling Language(UML)</strong> is a general-purpose, developmental, <em>modeling language</em> in the field of <em>software engineering</em>, that is intended to provide a standard way to visualize the design of a system.</p>
<h3 id="UML的目标">UML的目标</h3><p>一张图片胜过千言万语,这样的结论绝对也适用于UML.面向对象的概念要比UML出现的更早,因此当时没有标准的方法来组织和巩固面向对象开发.而且UML图表并不仅仅面向开发人员,它同样也应用到企业用户,以及其他任何对想要理解此系统的人.总之UML语言的目标是定义一个简单的建模机制来对所有当今复杂环境下系统进行建模.</p>
<h3 id="面向对象概念">面向对象概念</h3><p>一个对象包含数据和控制数据的方法,数据通常也称为属性,它用来描述对象(Object)的状态.类(Class)用来描述对象(Object)以及它们还建立了层次结构模拟真实世界系统.层次结构被表示为继承以及类也可以按照要求以不同的方式被关联起来.<br>对象是存在与我们身边的真实世界实体,面向对象里的基本概念比如抽象,封装,继承和多态都能够用UML语言表示.<br>下面是面向对象里一些基本概念.</p>
<ul>
<li>Objects: 对象代表一个实体,它也是UML里基本的构建块.</li>
<li>Class: 表示现实世界里一类具有共同特征的事物的抽象.</li>
<li>Abstraction: 抽象在Java语言里表现为一种过程的抽象,它隐藏程序的某些细节而只展示程序基本的功能.换句话说,抽象只描述了一个对象的基本特征.</li>
<li>Encapsulation: 封装是这样一种机制,它把数据封装起来,对于外面的对象来说这些数据(属性)是隐藏的.</li>
<li>Inheritance: 继承是从一个存在的基类派生出新类的机制.</li>
<li>Polymorphism: 一个基类的引用,可以指向多种派生类对象,具有多种不同的形态,这种现象就叫多态性.</li>
</ul>
<h3 id="UML的构建块">UML的构建块</h3><p>UML的构建块由以下三个主要元素构成：</p>
<h4 id="事物(Things)">事物(Things)</h4><p>事物是实体抽象化的最终结果,是模型中的基本成员,UML中包含结构事物,行为事物,分组事物和注释事物.</p>
<h5 id="结构事物">结构事物</h5><p>结构事物是模型中的静态部分,用来呈现概念和实体的表现元素,以下是软件建模中最常见的七种元素.</p>
<ul>
<li>Class: 是指具有相同属性,方法,关系和语义的对象的集合.<br>![img uml_class] (/images/uml/uml_class.jpg )</li>
<li>Interface: 接口是指类或组件所提供的服务（操作）,描述了类或组件对外可见的动作.<br>![ img uml_interface /images/uml/uml_interface.jpg )</li>
<li>Collaboration: 协作描述完成某个特定任务的一组类及其关联的集合,用于对使用情形的实现建模.<br>![ img uml_collaboration /images/uml/uml_collaboration.jpg )</li>
<li>Use Case: 用于表示系统所提供的服务,它定义了系统是如何被参与者所使用的,它描述的是参与者为了使用系统提供的某一完整功能而与系统之间发生一段对话.<br><img src="/images/uml/uml_usecase.jpg" alt=" img use_case "></li>
<li>Component: 组件是物理的,可替换的部分,包含接口的集合,例如COM+,JAVA BEANS等.<br><img src="/images/uml/uml_component.jpg" alt=" img component "></li>
<li>Node: 节点是系统在运行时存在的物理元素,代表一个可计算的资源,通常占用一些内存和具有处理能力.<br><img src="/images/uml/uml_node.jpg" alt=" img Node "></li>
</ul>
<h5 id="行为事物">行为事物</h5><p>行为事物指的是UML模型中的动态部分,如下：</p>
<ul>
<li>Interaction: 交互是在特定上下文中的一组对象,为了达到特定的目的而进行的一系列消息交换而组成的动作.<br><img src="/images/uml/uml_message.jpg" alt=" img interaction "></li>
<li>State machine: 它定义的状态序列对象通过事件进行响应,而事件是负责(responsible)状态变化的外部因素.<br><img src="/images/uml/uml_state.jpg" alt=" img state_machine "></li>
</ul>
<h5 id="分组事物">分组事物</h5><p>分组事物被定义为这样一种机制,即它能对UML模型元素进行分组,目前只有一种可用的分组事物：</p>
<ul>
<li><strong>Package</strong>: 结构事物,行为事物甚至分组事物都有可能放在一个包中.包纯粹是概念上的,只存在与开发阶段,而组件在运行时存在.<br><img src="/images/uml/uml_package.jpg" alt=" img uml_package "></li>
</ul>
<h5 id="注释事物">注释事物</h5><ul>
<li><strong>Note</strong>: 用于UML元素的解释部分.<br><img src="/images/uml/uml_note.jpg" alt=" img Note "><h4 id="关系(Relationship)">关系(Relationship)</h4>关系是UML的另一个重要构建块,它显示元素是任何彼此相互关联的.UML定义了四种可用的关系.<h5 id="Dependencies(依赖):_依赖描述了两个事物之间的语义关系,其中一个事物的变化会影响另一个事物-">Dependencies(依赖): 依赖描述了两个事物之间的语义关系,其中一个事物的变化会影响另一个事物.</h5><img src="/images/uml/uml_dependency.jpg" alt=" img dependency "><h5 id="Association(关联):_描述一组对象之间的连接的结构关系,如聚合关系(描述了整体和部分之间的结构关系)-">Association(关联): 描述一组对象之间的连接的结构关系,如聚合关系(描述了整体和部分之间的结构关系).</h5><img src="images/uml/uml_association.jpg" alt=" img association "><h5 id="Generalization(泛化):_是一般化-_特殊化的关系,在对象的世界里它描述了继承这类关系-">Generalization(泛化): 是一般化- 特殊化的关系,在对象的世界里它描述了继承这类关系.</h5><img src="/images/uml/uml_generalization.jpg" alt=" img generalization "><h5 id="Realization(实现):_实现定义了两个相连的元素间的一种关系,其中一个元素描述了未被实现的责任,而另一则实现了这些责任,这种关系存在与接口的情况下-">Realization(实现): 实现定义了两个相连的元素间的一种关系,其中一个元素描述了未被实现的责任,而另一则实现了这些责任,这种关系存在与接口的情况下.</h5><img src="/images/uml/uml_realization.jpg" alt=" img realization "></li>
</ul>
<h4 id="图(Diagrams)">图(Diagrams)</h4><p>图是事物集合的分类,所有的元素(elements),关系都用来制造一个完整的UML图,图也表示一个系统.<br>UML包含了九种图：</p>
<ul>
<li>类图(Class Diagram): 类图描述系统包含的类,类的内部结构以及类之间的关系.</li>
<li>对象图(Object Diagram): 对象图是类图的一个具体实例.</li>
<li>包图(Package Diagram): 包图表示包及其之间的依赖类图.</li>
<li>用例图(Usecase Diagram): 用例图从用户的角度出发描述系统的功能,需求,展示系统外部的各类角色与系统内部的各种用例之间的关系.</li>
<li>顺序图(Sequence Diagram): 表示对象之间动态合作的关系.</li>
<li>协作图(Collaboration Diagram): 描述对象之间的合作关系.</li>
<li>活动图(Activity Diagram): 描述了系统中各种活动的执行顺序.</li>
<li>状态图(Statechart Diagram): 状态图描述了一类对象的所有可能的状态以及事件发生时状态的转移条件.</li>
<li>部署图(Deployment Diagram): 定义了系统中软硬件的物理体系结构.</li>
<li>组件图(Compoment Diagram): 组件图也称构建图,它描述了代码部件的物理结构以及各部件之间的依赖关系.<h4 id="符号(Notation)">符号(Notation)</h4>UML符号在建模中是非常重要的一类元素,下面是一些基本的符号.</li>
</ul>
<h5 id="Structural_Things">Structural Things</h5><ul>
<li>Classes Notation<br><img src="/images/uml/notation_class.jpg" alt=" img notation_class "></li>
<li>Object Notation<br><img src="/images/uml/notation_object.jpg" alt=" img notation_object "></li>
<li>Interface Notation<br><img src="/images/uml/notation_interface.jpg" alt=" img notation_interface "></li>
<li>Collaboration Notation<br><img src="/images/uml/notation_collaboration.jpg" alt=" img notation_collaboration "></li>
<li>Use case Notation<br><img src="/images/uml/notation_usecase.jpg" alt=" img notation_usecase "></li>
<li>Actor Notation<br><img src="/images/uml/notation_actor.jpg" alt=" img notation_actor "></li>
<li>Initial State Notation<br><img src="/images/uml/notation_initialstate.jpg" alt=" img notation_initial_sate "></li>
<li>Final State Notation<br><img src="/images/uml/notation_finalstate.jpg" alt=" img notation_final_state "></li>
<li>Active Class Notation<br><img src="/images/uml/notation_activeclass.jpg" alt=" img notation_active_class "><br>Active class is used to represent concurrency in a system.</li>
<li>Component Notation<br><img src="/images/uml/notation_component.jpg" alt=" img notation_component "></li>
<li>Node Notation<br><img src="/images/uml/notation_node.jpg" alt=" img notation_node "><h5 id="Behavioural_Things">Behavioural Things</h5></li>
<li>Interactions<br><img src="/images/uml/notation_interaction.jpg" alt=" img notation_interaction"></li>
<li>State machines<br><img src="/images/uml/notation_statemachine.jpg" alt=" img notation_state_machine "><h5 id="Grouping_Things">Grouping Things</h5></li>
<li>Package Notation<br><img src="/images/uml/notation_package.jpg" alt=" img notation_package "><h5 id="Annotational_Things">Annotational Things</h5></li>
<li>Note Notation<br><img src="/images/uml/notation_note.jpg" alt=" img notation_note "><h5 id="Relationships">Relationships</h5></li>
<li>Dependency Notation<br><img src="/images/uml/notation_dependency.jpg" alt=" img notation_dependency "></li>
<li>Association Notation<br><img src="/images/uml/notation_association.jpg" alt=" img notation_association "></li>
<li>Generalizaion Notation<br><img src="/images/uml/notation_generalization.jpg" alt=" img notation_generalization "></li>
<li>Extensibility Notation<br><img src="/images/uml/notation_extensibility.jpg" alt=" img notation_extensibility "></li>
</ul>
<blockquote>
<p>This aritcal refer <a href="http://www.tutorialspoint.com/uml" target="_blank" rel="external">here</a>.</p>
</blockquote>
</span>
      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/uml/" rel="tag">#uml</a>
          
        </div>
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/posts/2016/02/28/design-pattern-observer-pattern/" rel="next" title="Design Pattern - Observer Pattern">
                <i class="fa fa-chevron-left"></i> Design Pattern - Observer Pattern
              </a>
            
          </div>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/posts/2016/03/08/html-encoding/" rel="prev" title="HTML Encoding (Character Sets)">
                HTML Encoding (Character Sets) <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
        <div class="ds-share flat" data-thread-key="posts/2016/03/07/unified-modeling-language-tutorial/"
     data-title="Understanding UML"
     data-content=""
     data-url="https://lechance.github.io/posts/2016/03/07/unified-modeling-language-tutorial/">
  <div class="ds-share-inline">
    <ul  class="ds-share-icons-16">

      <li data-toggle="ds-share-icons-more"><a class="ds-more" href="javascript:void(0);">分享到：</a></li>
      <li><a class="ds-weibo" href="javascript:void(0);" data-service="weibo">微博</a></li>
      <li><a class="ds-qzone" href="javascript:void(0);" data-service="qzone">QQ空间</a></li>
      <li><a class="ds-qqt" href="javascript:void(0);" data-service="qqt">腾讯微博</a></li>
      <li><a class="ds-wechat" href="javascript:void(0);" data-service="wechat">微信</a></li>

    </ul>
    <div class="ds-share-icons-more">
    </div>
  </div>
</div>
      
    </div>
  </div>


        </div>

        


        
  <div class="comments" id="comments">
    
      <div class="ds-thread" data-thread-key="posts/2016/03/07/unified-modeling-language-tutorial/"
           data-title="Understanding UML" data-url="https://lechance.github.io/posts/2016/03/07/unified-modeling-language-tutorial/">
      </div>
    
  </div>


      </div>

      
        
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            Table Of Contents
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            Overview
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel ">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" src="/upload/image/avatar.png" alt="Lechance Cheung" itemprop="image"/>
          <p class="site-author-name" itemprop="name">Lechance Cheung</p>
        </div>
        <p class="site-description motion-element" itemprop="description">The code to change the world</p>
        <nav class="site-state motion-element">
          <div class="site-state-item site-state-posts">
            <a href="/archives">
              <span class="site-state-item-count">43</span>
              <span class="site-state-item-name">posts</span>
            </a>
          </div>

          <div class="site-state-item site-state-categories">
            
              <span class="site-state-item-count">15</span>
              <span class="site-state-item-name">categories</span>
              
          </div>

          <div class="site-state-item site-state-tags">
            <a href="/tags">
              <span class="site-state-item-count">66</span>
              <span class="site-state-item-name">tags</span>
              </a>
          </div>

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="http://weibo.com/lechance" target="_blank">
                  
                    <i class="fa fa-weibo"></i> Weibo
                  
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://github.com/lechance" target="_blank">
                  
                    <i class="fa fa-globe"></i> Github
                  
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://guides.github.com/features/mastering-markdown/" target="_blank">
                  
                    <i class="fa fa-globe"></i> MD CheatSheet
                  
                </a>
              </span>
            
          
        </div>

        
        
          <div class="cc-license motion-element" itemprop="license">
            <a href="http://creativecommons.org/licenses/by-nc-sa/4.0" class="cc-opacity" target="_blank">
              <img src="/images/cc-by-nc-sa.svg" alt="Creative Commons" />
            </a>
          </div>
        

        <div class="links-of-author motion-element">
          
            <p class="site-author-name">Common Sites</p>
            
              <span class="links-of-author-item">
                <a href="https://developers.google.cn" target="_blank">Google Developers</a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://androidweekly.net/archive" target="_blank">Android Weekly</a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://rxjava.yuxingxin.com" target="_blank">RxJava Essentials</a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://hc.apache.org/index.html" target="_blank">Http Components</a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://simpledeveloper.com" target="_blank">Simple Developer</a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://www.ibm.com/developerworks/library" target="_blank">IBM(Technical Library)</a>
              </span>
            
          
        </div>

      </section>

      
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc-indicator-top post-toc-indicator">
            <i class="fa fa-angle-double-up"></i>
          </div>
          <div class="post-toc">
            
              
            
            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#What_is_UML"><span class="nav-number">1.</span> <span class="nav-text">What is UML</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#UML的目标"><span class="nav-number">2.</span> <span class="nav-text">UML的目标</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#面向对象概念"><span class="nav-number">3.</span> <span class="nav-text">面向对象概念</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#UML的构建块"><span class="nav-number">4.</span> <span class="nav-text">UML的构建块</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#事物(Things)"><span class="nav-number">4.1.</span> <span class="nav-text">事物(Things)</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#结构事物"><span class="nav-number">4.1.1.</span> <span class="nav-text">结构事物</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#行为事物"><span class="nav-number">4.1.2.</span> <span class="nav-text">行为事物</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#分组事物"><span class="nav-number">4.1.3.</span> <span class="nav-text">分组事物</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#注释事物"><span class="nav-number">4.1.4.</span> <span class="nav-text">注释事物</span></a></li></ol></li><li class="nav-item nav-level-4"><a class="nav-link" href="#关系(Relationship)"><span class="nav-number">4.2.</span> <span class="nav-text">关系(Relationship)</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#Dependencies(依赖):_依赖描述了两个事物之间的语义关系,其中一个事物的变化会影响另一个事物-"><span class="nav-number">4.2.1.</span> <span class="nav-text">Dependencies(依赖): 依赖描述了两个事物之间的语义关系,其中一个事物的变化会影响另一个事物.</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#Association(关联):_描述一组对象之间的连接的结构关系,如聚合关系(描述了整体和部分之间的结构关系)-"><span class="nav-number">4.2.2.</span> <span class="nav-text">Association(关联): 描述一组对象之间的连接的结构关系,如聚合关系(描述了整体和部分之间的结构关系).</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#Generalization(泛化):_是一般化-_特殊化的关系,在对象的世界里它描述了继承这类关系-"><span class="nav-number">4.2.3.</span> <span class="nav-text">Generalization(泛化): 是一般化- 特殊化的关系,在对象的世界里它描述了继承这类关系.</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#Realization(实现):_实现定义了两个相连的元素间的一种关系,其中一个元素描述了未被实现的责任,而另一则实现了这些责任,这种关系存在与接口的情况下-"><span class="nav-number">4.2.4.</span> <span class="nav-text">Realization(实现): 实现定义了两个相连的元素间的一种关系,其中一个元素描述了未被实现的责任,而另一则实现了这些责任,这种关系存在与接口的情况下.</span></a></li></ol></li><li class="nav-item nav-level-4"><a class="nav-link" href="#图(Diagrams)"><span class="nav-number">4.3.</span> <span class="nav-text">图(Diagrams)</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#符号(Notation)"><span class="nav-number">4.4.</span> <span class="nav-text">符号(Notation)</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#Structural_Things"><span class="nav-number">4.4.1.</span> <span class="nav-text">Structural Things</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#Behavioural_Things"><span class="nav-number">4.4.2.</span> <span class="nav-text">Behavioural Things</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#Grouping_Things"><span class="nav-number">4.4.3.</span> <span class="nav-text">Grouping Things</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#Annotational_Things"><span class="nav-number">4.4.4.</span> <span class="nav-text">Annotational Things</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#Relationships"><span class="nav-number">4.4.5.</span> <span class="nav-text">Relationships</span></a></li></ol></li></ol></li></ol></div>
            
          </div>
          <div class="post-toc-indicator-bottom post-toc-indicator">
            <i class="fa fa-angle-double-down"></i>
          </div>
        </section>
      

    </div>
  </aside>


      
    </main>

    <footer id="footer" class="footer">
      <div class="google-ad">
	  <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- myblogfootergooglead -->
<ins class="adsbygoogle"
     style="display:inline-block;width:468px;height:60px"
     data-ad-client="ca-pub-6226577131784709"
     data-ad-slot="6824128270"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

      </div>
      <div class="footer-inner">
        <script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js">
</script>

<div class="copyright" >
  
  &copy;  2015 - 
  <span itemprop="copyrightYear">2017</span>
  <span class="with-love">
    <i class="icon-next-heart fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Lechance Cheung</span>
</div>

<div class="powered-by">
  Powered by <a class="theme-link" href="http://hexo.io">Hexo</a>
</div>

<div class="theme-info">
  Theme -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT
  </a>
</div>

<span id="busuanzi_container_site_pv">
  &nbsp; | &nbsp;PV <span id="busuanzi_value_site_pv"></span> &nbsp;| &nbsp;UV <span id="busuanzi_value_site_uv"></span>
</span>



      </div>
    </footer>

    <div class="back-to-top"></div>
  </div>

  <script type="text/javascript" src="/vendors/jquery/index.js?v=2.1.3"></script>

  
  

  
    

  
    
  

  <script type="text/javascript">
    var duoshuoQuery = {short_name:"lechance"};
    (function() {
      var ds = document.createElement('script');
      ds.type = 'text/javascript';ds.async = true;
      ds.id = 'duoshuo-script';
      ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//lechance.github.io/embed_ua.js';
      ds.charset = 'UTF-8';
      (document.getElementsByTagName('head')[0]
      || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
  </script>
    
     


    
  

  
  <script type="text/javascript" src="/vendors/fancybox/source/jquery.fancybox.pack.js"></script>
  <script type="text/javascript" src="/js/fancy-box.js?v=0.4.5.2"></script>


  <script type="text/javascript" src="/js/helpers.js?v=0.4.5.2"></script>
  <script type="text/javascript" src="/vendors/velocity/velocity.min.js"></script>
<script type="text/javascript" src="/vendors/velocity/velocity.ui.min.js"></script>

<script type="text/javascript" src="/js/motion.js?v=0.4.5.2" id="motion.global"></script>


  <script type="text/javascript" src="/vendors/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  <script type="text/javascript" src="/vendors/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  
<script type="text/javascript" src="/js/bootstrap.scrollspy.js?v=0.4.5.2" id="bootstrap.scrollspy.custom"></script>


<script type="text/javascript" id="sidebar.toc.highlight">
  $(document).ready(function () {
    var tocSelector = '.post-toc';
    var $tocSelector = $(tocSelector);
    var activeCurrentSelector = '.active-current';

    $tocSelector
      .on('activate.bs.scrollspy', function () {
        var $currentActiveElement = $(tocSelector + ' .active').last();

        removeCurrentActiveClass();
        $currentActiveElement.addClass('active-current');

        $tocSelector[0].scrollTop = $currentActiveElement.position().top;
      })
      .on('clear.bs.scrollspy', function () {
        removeCurrentActiveClass();
      });

    function removeCurrentActiveClass () {
      $(tocSelector + ' ' + activeCurrentSelector)
        .removeClass(activeCurrentSelector.substring(1));
    }

    function processTOC () {
      getTOCMaxHeight();
      toggleTOCOverflowIndicators();
    }

    function getTOCMaxHeight () {
      var height = $('.sidebar').height() -
                   $tocSelector.position().top -
                   $('.post-toc-indicator-bottom').height();

      $tocSelector.css('height', height);

      return height;
    }

    function toggleTOCOverflowIndicators () {
      tocOverflowIndicator(
        '.post-toc-indicator-top',
        $tocSelector.scrollTop() > 0 ? 'show' : 'hide'
      );

      tocOverflowIndicator(
        '.post-toc-indicator-bottom',
        $tocSelector.scrollTop() >= $tocSelector.find('ol').height() - $tocSelector.height() ? 'hide' : 'show'
      )
    }

    $(document).on('sidebar.motion.complete', function () {
      processTOC();
    });

    $('body').scrollspy({ target: tocSelector });
    $(window).on('resize', function () {
      if ( $('.sidebar').hasClass('sidebar-active') ) {
        processTOC();
      }
    });

    onScroll($tocSelector);

    function onScroll (element) {
      element.on('mousewheel DOMMouseScroll', function (event) {
          var oe = event.originalEvent;
          var delta = oe.wheelDelta || -oe.detail;

          this.scrollTop += ( delta < 0 ? 1 : -1 ) * 30;
          event.preventDefault();

          toggleTOCOverflowIndicators();
      });
    }

    function tocOverflowIndicator (indicator, action) {
      var $indicator = $(indicator);
      var opacity = action === 'show' ? 1 : 0;
      $indicator.velocity ?
        $indicator.velocity('stop').velocity({
          opacity: opacity
        }, { duration: 100 }) :
        $indicator.stop().animate({
          opacity: opacity
        }, 100);
    }

  });
</script>

<script type="text/javascript" id="sidebar.nav">
  $(document).ready(function () {
    var html = $('html');
    var TAB_ANIMATE_DURATION = 200;
    var hasVelocity = $.isFunction(html.velocity);

    $('.sidebar-nav li').on('click', function () {
      var item = $(this);
      var activeTabClassName = 'sidebar-nav-active';
      var activePanelClassName = 'sidebar-panel-active';
      if (item.hasClass(activeTabClassName)) {
        return;
      }

      var currentTarget = $('.' + activePanelClassName);
      var target = $('.' + item.data('target'));

      hasVelocity ?
        currentTarget.velocity('transition.slideUpOut', TAB_ANIMATE_DURATION, function () {
          target
            .velocity('stop')
            .velocity('transition.slideDownIn', TAB_ANIMATE_DURATION)
            .addClass(activePanelClassName);
        }) :
        currentTarget.animate({ opacity: 0 }, TAB_ANIMATE_DURATION, function () {
          currentTarget.hide();
          target
            .stop()
            .css({'opacity': 0, 'display': 'block'})
            .animate({ opacity: 1 }, TAB_ANIMATE_DURATION, function () {
              currentTarget.removeClass(activePanelClassName);
              target.addClass(activePanelClassName);
            });
        });

      item.siblings().removeClass(activeTabClassName);
      item.addClass(activeTabClassName);
    });

    $('.post-toc a').on('click', function (e) {
      e.preventDefault();
      var targetSelector = escapeSelector(this.getAttribute('href'));
      var offset = $(targetSelector).offset().top;
      hasVelocity ?
        html.velocity('stop').velocity('scroll', {
          offset: offset  + 'px',
          mobileHA: false
        }) :
        $('html, body').stop().animate({
          scrollTop: offset
        }, 500);
    });

    // Expand sidebar on post detail page by default, when post has a toc.
    motionMiddleWares.sidebar = function () {
      var $tocContent = $('.post-toc-content');
      if (CONFIG.sidebar === 'post') {
        if ($tocContent.length > 0 && $tocContent.html().trim().length > 0) {
          displaySidebar();
        }
      }
    };
  });
</script>



  <script type="text/javascript" src="/js/bootstrap.js"></script>

  
  

  
  
  
  
  	 <!-- custom analytics part create by xiamo -->
<script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.1.js"></script>
<script>AV.initialize("cHqcCBDQtcbkltuUTyplEYWJ-gzGzoHsz", "SkioJGixXR48ACpgA0W2lOWd");</script>
<script>
function showTime(Counter) {
	var query = new AV.Query(Counter);
	$(".leancloud_visitors").each(function() {
		var url = $(this).attr("id").trim();
		query.equalTo("url", url);
		query.find({
			success: function(results) {
				if (results.length == 0) {
					var content = '0 ' + $(document.getElementById(url)).text();
					$(document.getElementById(url)).text(content);
					return;
				}
				for (var i = 0; i < results.length; i++) {
					var object = results[i];
					var content = object.get('time') + ' ' + $(document.getElementById(url)).text();
					$(document.getElementById(url)).text(content);
				}
			},
			error: function(object, error) {
				console.log("Error: " + error.code + " " + error.message);
			}
		});

	});
}

function addCount(Counter) {
	var Counter = AV.Object.extend("Counter");
	url = $(".leancloud_visitors").attr('id').trim();
	title = $(".leancloud_visitors").attr('data-flag-title').trim();
	var query = new AV.Query(Counter);
	query.equalTo("url", url);
	query.find({
		success: function(results) {
			if (results.length > 0) {
				var counter = results[0];
				counter.fetchWhenSave(true);
				counter.increment("time");
				counter.save(null, {
					success: function(counter) {
						var content =  counter.get('time') + ' ' + $(document.getElementById(url)).text();
						$(document.getElementById(url)).text(content);
					},
					error: function(counter, error) {
						console.log('Failed to save Visitor num, with error message: ' + error.message);
					}
				});
			} else {
				var newcounter = new Counter();
				newcounter.set("title", title);
				newcounter.set("url", url);
				newcounter.set("time", 1);
				newcounter.save(null, {
					success: function(newcounter) {
					    console.log("newcounter.get('time')="+newcounter.get('time'));
						var content = newcounter.get('time') + ' ' + $(document.getElementById(url)).text();
						$(document.getElementById(url)).text(content);
					},
					error: function(newcounter, error) {
						console.log('Failed to create');
					}
				});
			}
		},
		error: function(error) {
			console.log('Error:' + error.code + " " + error.message);
		}
	});
}
$(function() {
	var Counter = AV.Object.extend("Counter");
	if ($('.leancloud_visitors').length == 1) {
		addCount(Counter);
	} else if ($('.post-title-link').length > 1) {
		showTime(Counter);
	}
}); 
</script>
  
  
<!-- mathjax config similar to math.stackexchange -->

<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    tex2jax: {
      inlineMath: [ ['$','$'], ["\\(","\\)"] ],
      processEscapes: true
    }
  });
</script>

<script type="text/x-mathjax-config">
    MathJax.Hub.Config({
      tex2jax: {
        skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
      }
    });
</script>

<script type="text/x-mathjax-config">
    MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax(), i;
        for(i=0; i < all.length; i += 1) {
            all[i].SourceElement().parentNode.className += ' has-jax';
        }
    });
</script>

<script type="text/javascript" src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
</body>
</html>
